/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
#ifndef __GLUTILS_H___
#define __GLUTILS_H___

#include "GL/gl.h"
/*
static int lastglerror;
#define GLCHECK() { if ( (lastglerror = glGetError()) != 0) { printf("glGetError at %s:%d yielded %d, '%s'\n", \
__FILE__, __LINE__, lastglerror, gluErrorString(lastglerror)); ; } }
*/
//converts screen coords to opengl coords
void screenToGl(const int screenX, const int screenY, const double screenZ,
                     float &glX, float &glY, float &glZ);

//converts opengl coords to screen coords
void glToScreen(const float glX, const float glY, const float glZ,
                int &screenX, int &screenY, double &screenZ);

//function for drawing text
void drawText(float x, float y, float z, void *font, const char *string);

//get text width in pixels
int getTextWidth(void *font, const char *string);

    
#endif
